/*
因为环境变量只能存单行文字，所以通过这个js将密钥和公钥转成base64格式
*/ 
//导入fs和path模块
const fs = require('fs');
const path = require('path');

// 读取密钥文件
const privatekey = fs.readFileSync(path.join('config', 'private.key'));
const publickey = fs.readFileSync(path.join('config', 'public.key'));

// 转换成base64格式
const privateKeyBase64 = Buffer.from(privatekey).toString('base64');
const publicKeyBase64 = Buffer.from(publickey).toString('base64');

// 输出转换结果
console.log('\nprivate key:');
console.log(privateKeyBase64);

console.log('\npublic key:');
console.log(publicKeyBase64);